<template>
  <div class="icon">
    <van-swipe class="my-swipe" :loop="false" :show-indicators="false">
      <van-swipe-item v-for="(item1,index1) in tabJson" :key="index1">
        <ul class="tab">
          <li v-for="(item, index) in json.data.iconList" :key="item.id" v-show="(index1+1)*8>index&&index1*8<(index+1)">
            <div class="iconTab">
              <img :src="item.imgUrl" alt="" />
            </div>
            <span>{{ item.desc }}</span>
          </li>
        </ul>
      </van-swipe-item>
    </van-swipe>
  </div>
</template>

<script>
import json from "../../../../static/mock/index.json";
export default {
  data() {
    return {
      json,
      tab: json.data.iconList,
      firstTab:[],
      secTab:[]
    };
  },
  created(){
    if(this.tabJson){

    }
  },
  computed: {
    tabJson() {
      return Math.ceil(this.tab.length / 8);
    },
  },
};
</script>

<style scoped lang="scss">
swiper{
  overflow: hidden;
}
.my-swipe {
  height: 175px;
}
.tab {
  padding: 10px 20px;
  height: 175px;
  background-color: #ffffff;
  display: flex;
  justify-content: start;
  flex-wrap: wrap;
  li {
    width: 70px;
    height: 70px;
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-direction: column;
    font-size: 15px;
    margin: 0 9px;
  }
  .iconTab {
    width: 50px;
    height: 50px;
    border-radius: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    img {
      width: 50px;
      height: 50px;
    }
  }
}
</style>